yum erase postgresql-server postgresql postgresql-python
echo "exclude=postgresql*" >> /etc/yum.repos.d/CentOS-Base.repo
#Download and install the RPMs from http://yum.pgsqlrpms.org:
#wget http://yum.pgsqlrpms.org/reporpms/8.3/pgdg-centos-8.3-7.noarch.rpm
wget http://yum.postgresql.org/8.4/redhat/rhel-5-i386/pgdg-centos-8.4-3.noarch.rpm
#wget http://yum.postgresql.org/9.0/redhat/rhel-5-i386/pgdg-centos90-9.0-5.noarch.rpm
#wget http://yum.postgresql.org/8.4/redhat/rhel-5-x86_64/pgdg-centos-8.4-3.noarch.rpm
#wget http://yum.pgsqlrpms.org/reporpms/8.3/pgdg-centos-8.3-7.noarch.rpm
#aggiungere l'archivio per openvpn
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
#aggiungere l'archivio per postgres
rpm -ivh pgdg-centos-*.rpm
#installazione postgres
yum install postgresql postgresql-server postgresql-contrib postgresql-devel

#yum install postgresql90 postgresql90-server postgresql90-contrib postgresql90-devel

#installazione openvpn
yum install openvpn

# inizializare il db 
/etc/init.d/postgresql initdb

#modifca ai file pg_hba.conf
vi /var/lib/pgsql/pg_hba.conf

#modifica al file postgresql.conf 
vi /var/lib/pgsql/posgresql.conf

#fare lo start
/etc/init.d/postgresql start

# da utente postgres creare utente e il db 
# su - postgres
# createuser -P andromeda
# psql

#CREATE DATABASE bas OWNER = andromeda ENCODING = 'SQL_ASCII' TEMPLATE = template0;

# Aggiornare i servizi per lo start automatico
chkconfig openvpn on
chkconfig postgres on

